package com.ruoyi.common.core.domain.entity;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 商品分类对象 sy_category
 * 
 * @author CX330
 * @date 2024-12-22
 */
public class SyCategory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 分类id主键 */
    private Long categoryId;

    /** 分类名称 分类名称 */
    @Excel(name = "分类名称 分类名称")
    private String categoryName;

    /** 图标 logo */
    @Excel(name = "图标 logo")
    private String icon;


    /** 分类名称的状态（0正常，1停用） */
    @Excel(name = "分类名称的状态", readConverterExp = "0=正常，1停用")
    private String categoryStatus;

    private Long ParentId;

    private List<SyCategory> children = new ArrayList<>();

    public void setCategoryId(Long categoryId) 
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId() 
    {
        return categoryId;
    }
    public void setCategoryName(String categoryName) 
    {
        this.categoryName = categoryName;
    }

    public String getCategoryName() 
    {
        return categoryName;
    }
    public void setIcon(String icon) 
    {
        this.icon = icon;
    }

    public String getIcon() 
    {
        return icon;
    }
    public void setCategoryStatus(String categoryStatus) 
    {
        this.categoryStatus = categoryStatus;
    }

    public String getCategoryStatus() 
    {
        return categoryStatus;
    }

    public Long getParentId() {
        return ParentId;
    }

    public void setParentId(Long parentId) {
        ParentId = parentId;
    }

    public List<SyCategory> getChildren() {
        return children;
    }

    public void setChildren(List<SyCategory> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("categoryId", getCategoryId())
            .append("categoryName", getCategoryName())
            .append("parentId", getParentId())
            .append("icon", getIcon())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("categoryStatus", getCategoryStatus())
            .toString();
    }
}
